//
//  ACEStudentDetailLisDateFooterView.m
//  ACE
//
//  Created by zhangtao on 2018/8/13.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "ACEStudentDetailLisDateFooterView.h"

@implementation ACEStudentDetailLisDateFooterView
{
    UILabel *moneyLab;
}
-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
        self.backgroundColor = [UIColor whiteColor];
        UIView *maskView = [[UIView alloc]initWithFrame:CGRectMake(10, frame.size.height-60, frame.size.width-20, 60)];
        maskView.backgroundColor = [UIColor whiteColor];
        [self addSubview:maskView];
        
        maskView.layer.borderColor = deepGreen.CGColor;
        maskView.layer.borderWidth = 1;
        maskView.layer.cornerRadius = 30;
        maskView.layer.masksToBounds = YES;
        
        moneyLab = [[UILabel alloc]initWithFrame:CGRectMake(maskView.frame.size.width/2-80, maskView.frame.size.height/2-10, 80, 20)];
        [maskView addSubview:moneyLab];
        moneyLab.text = @"90";
        moneyLab.font = [UIFont systemFontOfSize:20];
        moneyLab.textColor = deepGreen;
        
        UILabel *moneyMark = [[UILabel alloc]initWithFrame:CGRectMake(moneyLab.frame.origin.x-10, maskView.frame.size.height/2, 10, 10)];
        moneyMark.text = @"$";
        moneyMark.font = [UIFont systemFontOfSize:12];
        moneyMark.textColor = deepGreen;
        [maskView addSubview:moneyMark];
        
        
        UILabel *titleLab = [[UILabel alloc]initWithFrame:CGRectMake(moneyMark.frame.origin.x-50, maskView.frame.size.height/2-10, 50, 20)];
        titleLab.text = @"总计:";
        titleLab.font = [UIFont systemFontOfSize:20];
        titleLab.textColor = deepGreen;
        [maskView addSubview:titleLab];
        
        UIButton *submitBtn = [[UIButton alloc]initWithFrame:CGRectMake(maskView.frame.size.width/2, 0,maskView.frame.size.width/2, maskView.frame.size.height)];
        [maskView addSubview:submitBtn];
        [submitBtn setTitle:@"确定" forState:UIControlStateNormal];
        submitBtn.backgroundColor = deepGreen;
        
        CAShapeLayer *borderLayer = [CAShapeLayer layer];
        borderLayer.frame =  submitBtn.frame;
        borderLayer.lineWidth = 1.f;
        borderLayer.strokeColor = deepGreen.CGColor;
        borderLayer.fillColor = [UIColor clearColor].CGColor;
        
        UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, submitBtn.frame.size.width, submitBtn.frame.size.height) byRoundingCorners:UIRectCornerBottomRight | UIRectCornerTopRight cornerRadii:CGSizeMake(10, 20)];//[UIBezierPath bezierPathWithRoundedRect:self.frame cornerRadius:10];
        //    maskLayer.path = bezierPath.CGPath;
        borderLayer.path = bezierPath.CGPath;
        
        [submitBtn.layer insertSublayer:borderLayer atIndex:0];
        
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
